<template>
  <div>
    <div class="page-header">
      <h1>专辑
        <small>JJ's Albums</small>
      </h1>
    </div>
    <el-row>
      <el-col :span="8" v-for="(item,index) in albums" :key="index">
        <el-card :body-style="{ padding: '0px' }">
          <router-link :to="'/album/'+item.id"><img :src="item.picUrl" class="image"></router-link>
          <div style="padding: 14px 0px;">
            <p class="titleCenter"><router-link :to="'/album/'+item.id">{{item.name}}</router-link></p>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  import {album} from '../request/req'

  export default {
    name: "album",
    mounted() {
      album(3684, 39).then(res => {
        this.size = res.data.albumSize;
        this.albums = res.data.hotAlbums;
      })
    },
    data() {
      return {
        albums: [],
        currentDate: new Date(),
        size: 0
      }
    }
  }
</script>

<style scoped>
  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }

  .titleCenter {
    text-align: center;
    line-height: 100%;
    margin-bottom: 0px;
  }

  p.titleCenter > a {
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
</style>
